<html>
<head>
<title>Comparison of DateApp and "Hello World"</title>
</head>
<body>
<table width=100%>
<tr>
<td align=left>
<a href="index.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=bottom border=0 alt="Previous | "></a><a
href="classdef.html"><img src=../../images/NextArrow.gif width=26 height=26 align=bottom border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=bottom border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/javaHeader.gif width=26 height=26 align=bottom border=0 alt="Writing Java Programs | "></a>
<td>
<td align=right>
<a href="index.html"><strong><em>The Anatomy of a Java Application</em></strong></a>
</td>
</tr>
</table>
<p>
<hr size=4>

<h2>
    Comparison of DateApp and "Hello World"
</h2>
<p>
<blockquote>

This page provides a comparison between the DateApp application and
<a href="../../getStarted/application/index.html">The "Hello World" Application</a><a href="../../getStarted/application/index.html"><img src="../../images/getStartedIcon.gif" width=20 height=20 border=0 alt="(in the Getting Started trail)"></a>
If you are not familiar with the "Hello World" application or are not
interested in how these two programs differ, just skip this page and go
on to the <a href="classdef.html">next</a>.
<p>
The bold lines in the two program listings below highlight where
the programs differ from one another. Specifically,
<ul>
<li>
<code>DateApp</code> imports the Date class
<li>
the applications have different names: <code>DateApp</code>
vs. <code>HelloWorldApp</code>
<li>
<code>DateApp</code> creates a Date object
<li>
the applications print different output
</ul>

<h4>The DateApp Application</h4>
<blockquote>
<pre>
<strong>import java.util.Date;</strong>
class <strong>DateApp</strong> {
    public static void main (String args[]) {
        <strong>Date today = new Date();</strong>
        System.out.println(<strong>today</strong>);
    }
}
</pre>
</blockquote>

<h4>The "Hello World" Application</h4>
<blockquote>
<pre>
class <strong>HelloWorldApp</strong> {
    public static void main (String args[]) {
        System.out.println(<strong>"Hello World!"</strong>);
    }
}
</pre>
</blockquote>

</blockquote>
<p>
<hr size=4>
<p>
<table width=100%>
<tr>
<td align=left>
<a href="index.html"><img src=../../images/PreviousArrow.gif width=26 height=26 align=top border=0 alt="Previous | "></a><a
href="classdef.html"><img src=../../images/NextArrow.gif width=26 height=26 align=top border=0 alt="Next | "></a><a
href="../../index.html"><img src=../../images/WayUpArrow.gif width=26 height=26 align=top border=0 alt="Trail Map | "></a><a
href="../index.html"><img src=../../images/javaHeader.gif width=26 height=26 align=top border=0 alt="Writing Java Programs | "></a>
<td>
<td align=right>
<a href="index.html"><strong><em>The Anatomy of a Java Application</em></strong></a>
</td>
</tr>
</table>
</body>
</html>
